﻿
    using Chain.BLL;
    using Chain.Model;
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public partial class SysNotice : PageBase
    {

        public string NoticeCode;

        public string RelaseName;
        public string RelaseTime;


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                if (base.Request.QueryString["NoticeID"] != "0")
                {
                    string strNoticeID = base.Request.QueryString["NoticeID"].ToString();
                    Chain.Model.SysNotice modelNotice = new Chain.BLL.SysNotice().GetModel(Convert.ToInt32(strNoticeID));
                    this.spNoticeCode.InnerText = modelNotice.SysNoticeCode;
                    this.spRelaseName.InnerText = modelNotice.SysNotieceName;
                    this.NoticeID.Value = strNoticeID;
                    this.spRelaseTime.InnerText = modelNotice.SysNoticeTime.ToString();
                    this.txtNoticeTitle.Value = modelNotice.SysNoticeTitle;
                    this.txtNoticeDetail.Value = HTMLDecodeText(modelNotice.SysNoticeDetail);
                }
                else
                {
                    this.spNoticeCode.InnerText = DateTime.Now.ToString("yyMMddHHmmss");
                    this.spRelaseName.InnerText = PubFunction.UserIDTOName(base._UserID);
                    this.spRelaseTime.InnerText = DateTime.Now.ToShortDateString();
                }
            }
        }
        public string HTMLDecodeText(string text)
        {
            string stringstr = "";
            if (!string.IsNullOrEmpty(text) && text != "")
            {

                stringstr = text.Replace("&lt;", "<");
                stringstr = text.Replace("&gt;", ">");
                stringstr = System.Web.HttpContext.Current.Server.HtmlDecode(stringstr).Trim();
            }

            return stringstr;

        }
    }


